package lu.med.praxiswahl.wahlumed.client.kalender;

import javax.swing.AbstractSpinnerModel;

/**
 * 
 * @author Lars Holger Roth
 */
public class SpinnerModel extends AbstractSpinnerModel
{
    int year = 2008;

    public SpinnerModel(int year)
    {
	this.year = year;
    }

    @Override
    public Object getNextValue()
    {
	year++;
	return "" + year;
    }

    @Override
    public Object getPreviousValue()
    {
	year--;
	return "" + year;
    }

    @Override
    public Object getValue()
    {
	return "" + year;
    }

    @Override
    public void setValue(Object val)
    {
	year = Integer.parseInt((String) val);
    }
}